<html>
	<head>
		<title>Subdistrict Insert form</title>
		<link rel="stylesheet" href="style.css">
	</head>
	<body>
		<table id="contentTable">
			<tr>
				<td colspan="2" id="pageheader">
					health information system
				</td>
			</tr>
			<tr>
				<td id="mainnav">
					<div class="menuitem">Districts</div>
					<div class="menuitem">Sub Districts</div>
					<div class="menuitem">Communities</div>
					<!-- <div class="menuitem">nutrition</div> -->
					<div class="menuitem">CHO</div>
					<!-- <div class="menuitem">family planning</div> -->
				</td>
				<td id="content">
					<div id="divPageMenu">
						<!-- <span class="menuitem" >districts</span>
						<span class="menuitem" >sub districts</span>
						<span class="menuitem" >communities</span>
						<span class="menuitem" >view map</span> -->
						<input type="text" id="txtSearch">
						<span class="menuitem">search</span>		
					</div>
					<div id="divStatus" class="status">
						status message
					</div>
					<div id="divContent">
						<form action="subdistrict_insert_form.php" method="POST">
							<table class="tableForm">
								<tr>
									<td class="label">Subdistrict Name: </td>
									<td class="field"><input type="text" name="subdistrict_name" value="Subdistrict Name"/></td>
								</tr>
								<tr>
									<td class="label">District ID: </td>
									<td class="field"><input type="text" name="district_id" value="District ID"/></td>
								</tr>
								<tr>
									<td class="label"></td>
									<td class="label"><input type="submit" name="submit" value="add"/></td>
								</tr>
							</table>
						</form>
					</div>
				</td>
			</tr>
		</table>
	
		
		
		
		<?php
		include_once("community_table_functions.php");
		
		$new_subd = new subdistrict();
		
		if(isset($_REQUEST['subdistrict_name']) && isset($_REQUEST['district_id'])){
			$subdistrictname = $_REQUEST['subdistrict_name'];
			$districtid = $_REQUEST['district_id'];
			$new_subd->insert_into_subdistrict($subdistrictname, $districtid);
			echo "new district successfully added!";
		}
		?>
		
	</body>
</html>